Skip to content

fix(pathFilter): don't let a release tag on a descendant commit hide pending changes - #94

Merged
jmongard merged 1 commit into
jmongard:masterfrom
juan-rojas-affirm:fix/pathfilter-ancestor-tags
Jul 24, 2026
Merged

fix(pathFilter): don't let a release tag on a descendant commit hide pending changes#94
jmongard merged 1 commit into
jmongard:masterfrom
juan-rojas-affirm:fix/pathfilter-ancestor-tags

Conversation

@juan-rojas-affirm

@juan-rojas-affirm juan-rojas-affirm commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Problem

GitProvider.computeRelevantShas() bounds the pathFilter walk using every tag
matching releaseTagNameFormat, without checking whether that tag's commit is an
ancestor of head:

val versionTagIds = getVersionTagObjectIds(tags)   // all matching tags, repo-wide
...
filterWalk.markUninteresting(filterWalk.parseCommit(oid))

RevWalk.markUninteresting() propagates UNINTERESTING to all ancestors of the given
commit. If a release tag sits on a commit that is a descendant of head, marking it
uninteresting also marks head (and everything before it) uninteresting. Every
pending commit since the real last release then looks irrelevant, and the version
silently fails to bump — no error, getReleaseVersion() just returns the last known
version.

This is a race: it only shows up when computing the version for an older commit is
delayed long enough for another build, on a newer descendant commit, to finish and
push its own release tag first.

Repro:

  1. v1.0.0 is tagged.
  2. Commit A (fix:) lands — pending.
  3. Commit B (feat:), a descendant of A, lands and gets released as v1.1.0 before
    A's own version computation runs.
  4. Computing the version as of commit A now sees zero pending changes instead of the
    expected patch bump.

Fix

Restrict tag boundaries to ancestors of head (via RevWalk.isMergedInto()) before
using them to bound the pathFilter walk.

Testing

Added two regression tests to GitProviderPathFilterTest reproducing the above shape
(semVersion and changeLog). Confirmed both fail pre-fix with the same symptom and
pass post-fix.

…n earlier commit's version walk

pathFilter's boundary computation (computeRelevantShas -> getVersionTagObjectIds)
fed EVERY tag matching releaseTagNameFormat into RevWalk.markUninteresting(),
regardless of whether that tag's commit was actually an ancestor of `head`.

markUninteresting() propagates to all ancestors of the commit it's given. If a
release tag sits on a commit that is a *descendant* of `head` (e.g. a build for
an older commit is retried/delayed and, by the time it runs, a later commit has
already been released), marking that descendant uninteresting also marks `head`
itself uninteresting -- making every pending commit since the real last release
look irrelevant. The version then silently fails to bump, with no error.

Restrict tag boundaries to actual ancestors of `head` via RevWalk.isMergedInto()
before using them to bound the pathFilter walk.
@jmongard
jmongard merged commit f8df5c8 into jmongard:master Jul 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants